import React, { Component } from 'react';
import { connect } from 'react-redux'
import { Modal, Form, Input, Button } from 'antd';
const FormItem = Form.Item;


class RepairRemarkViewModal extends Component {
    constructor(props) {
        super(props);
    }

    okHandler = () => {
        const { onRepairRemarkHandle } = this.props;
        this.props.form.validateFields((err, values) => {
          if (!err) {
            onRepairRemarkHandle(values);
            this.props.form.resetFields();
          }
        });
      };

    render() {

        const { alarm, dispatch, item } = this.props;
        const { getFieldDecorator } = this.props.form;

        return (
            <span>
                <Modal
                    maskClosable={this.props.maskClosable}
                    confirmLoading={this.props.confirmLoading}
                    title={this.props.title}
                    visible={this.props.visible}
                    onOk={this.okHandler}
                    onCancel={this.props.onCancel}
                    key={this.props.newKey}
                >
                    <Form layout='horizontal'>
                        <FormItem style={{ marginBottom: '0px' }}>
                            {getFieldDecorator('detailId', { initialValue: item.id_ })(
                                <Input type="hidden" />
                            )}
                        </FormItem>
                        <FormItem>
                            {
                                getFieldDecorator('repairRemark', {
                                    initialValue: item.repairRemark,
                                })(<Input type="textarea" autosize={{ minRows: 4, maxRows: 4 }} />)
                            }
                        </FormItem>
                    </Form>
                </Modal>
            </span>
        );
    }
}

export default Form.create()(RepairRemarkViewModal)